package com.crm.customers.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.crm.base.dao.BaseDao;
import com.crm.customers.dao.ContractPerformanceDao;
import com.crm.customers.model.ContractPerformance;

@Repository("contractPerformanceDao")
public class ContractPerformanceDaoImpl extends BaseDao implements ContractPerformanceDao {
	
	private static final String MAPPER_NAMESPACE = "ContractPerformanceMapper.";

	@Override
	public ContractPerformance insertContractPerformance(ContractPerformance cp) {
		insert(MAPPER_NAMESPACE+"insertContractPerformance", cp);
		return cp;
	}

	@Override
	public List<ContractPerformance> checkIsExist(Long conid) {
		return selectList(MAPPER_NAMESPACE+"checkisexist", conid);
	}


	@Override
	public int updataContractPerformance(ContractPerformance cp) {
		return update(MAPPER_NAMESPACE+"updataContractPerformance", cp);
	}
	
	@Override
	public List<ContractPerformance> getPerFormanceByUid(Long uid) {
		return selectList(MAPPER_NAMESPACE+"selPerformanceByUid", uid);
	}

	@Override
	public int selDayPerformanceByUid(Long uid) {
		return selectOne(MAPPER_NAMESPACE+"selDayPerformanceByUid", uid);
	}

	@Override
	public List<ContractPerformance> selAllUserPerformance() {
		return selectList(MAPPER_NAMESPACE+"selAllUserPerformance");
	}

	@Override
	public int deleteContractPerformance(Long conid) {
		return update(MAPPER_NAMESPACE+"deleteContractPerformance", conid);
	}
}
